var firstNames = Array("I EAT BABIES","Andrew","Brendan", "Shad", "Geoff", "Chinua", "David","Colin", "Michael", "Alexander", "Annie", "Rae", "Michelle", "Burt", "Emily", "Arthur", "Nila", "Alcatraz", "Enoch", "Guy", "Alan", "Malcom", "Yolanda", "Antonio", "John", "Wolfgang","Gertrude", "Lawrence", "Josh", "Henry", "Emilia","Ted", "Nita");

var lastNames = Array("- Cheat Character","WAIT FOR IT","Rosen", "Bolding", "Benshoof", "Massey", "Umoja", "Weaver", "Wiggens", "Nyugen", "Jha", "Fernandez", "Rossi", "Garcia", "Smith", "Gilson", "Llanes", "Vice", "Reinhold", "Macklin", "Schiff", "Schubert","Lord", "Ryerse", "Robot", "Armstrong", "Croteau", "Arroyo", "Suzuki", "Sato","Endo", "Ito", "Wong", "Li", "Goldberg", "Weingarten", "Singer", "Cantor", "Smirnov", "Ivanov");

var shipNames = Array("Titanic", "General Slocum", "Tek Sing", "Sultana", "Bulwark", "Eastland", "Estonia", "Vanguard", "Ramdas", "Captain", "Atlantic", "Grandcamp", "Shamia", "Ramdas", "Novorossiysk", "Bukoba", "Toya Maru", "Kiangya");


//this array is for crew that should be generated in order and only once
var baseCrewRoles = Array("Captain", "First Officer", "Navigator","Pilot", "Engineer", "Medical Officer", "Head of Security", "Cook");

//this array is for crew members above te base
var extraCrewRoles = Array("Navigator", "Engineer", "Medical Officer", "Security Officer", "Cook", "Janitor", "Passenger", "Passenger", "Passenger");

function generateCrewName() 
{
	var first =  firstNames[Math.floor(Math.random()*firstNames.length)];
	var last =  lastNames[Math.floor(Math.random()*lastNames.length)];
	return first + " " +last;
	
}

function generateShipName() 
{
	return shipNames[Math.floor(Math.random()*shipNames.length)];	
}


function make_crew(size,canvas)
{
	var i = 0;
	
	for(i=0;i<size && i< baseCrewRoles.length;i++)
	{
		//alert(i);
		make_new_crewmember(baseCrewRoles[i],canvas);
	}
	
	for(;i<size;i++)
	{
		make_new_crewmember(extraCrewRoles[Math.floor(Math.random()*extraCrewRoles.length)], canvas);
	}
	
	//alert(crew.length);

}


function make_new_crewmember(role,canvas)
{
	//alert("startass"+crew.length)
	c = new Object();
	c.name = generateCrewName();
	c.x = 50;
	c.y = 50;
	c.health = 100;
	c.behavoir = [function(){wander(c,canvas);}];//add per role logic here
	c.canvas = canvas;
	c.color = [Math.floor(Math.random()*256),Math.floor(Math.random()*256),Math.floor(Math.random()*256)];
	c.roleid = role;
	c.radius = 1;
	crew.push(c);
	//alert("endass"+crew.length)
	return c;
}
